<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <link rel="stylesheet" href="/cms/css/font.css">
  <link rel="stylesheet" href="/cms/css/xadmin.css">
  <link rel="stylesheet" href="/cms/layui/css/layui.css">
  <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
  <!--[if lt IE 9]>
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>

<body class="form-wrap">

<div class="layui-fluid">
  <div class="layui-row layui-col-space15">

    <div class="layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-header">文章信息</div>
        <div class="layui-card-body">

          <form class="layui-form" action="" lay-filter="example">
            <input type="hidden" id="ArticleId" name="id" th:value="${contact.id}">
            <div class="layui-row layui-col-space10 layui-form-item">

              <div class="layui-col-lg6">
                <label class="layui-form-label">留言者邮箱：</label>
                <div class="layui-input-block">
                  <input type="text" th:value="${contact.email}" disabled="disabled" lay-verify="required"
                         placeholder="" autocomplete="off"
                         class="layui-input">
                </div>
              </div>

              <div class="layui-col-lg6">
                <label class="layui-form-label">留言人：</label>
                <div class="layui-input-block">
                  <input type="text" th:value="${contact.userName}" disabled="disabled" autocomplete="off"
                         class="layui-input">
                </div>
              </div>

              <div class="layui-col-lg6">
                <label class="layui-form-label">留言内容：</label>
                <div class="layui-input-block">
                  <input type="text" th:value="${contact.contact}" disabled="disabled" lay-verify="required"
                         placeholder="" autocomplete="off"
                         class="layui-input">
                </div>

              </div>



            </div>




            <div class="layui-form-item">

              <div class="layui-input-block" th:switch="${contact.status} == 1">
                <div th:case="true">
                  <input type="radio" name="status" checked="checked" value="1" title="显示">
                  <input type="radio" name="status" value="2" title="不显示">
                </div>

                <div th:case="false">
                  <input type="radio" name="status" value="1" title="显示">
                  <input type="radio" name="status" checked="checked" value="2" title="不显示">
                </div>
              </div>
            </div>



            <div class="layui-form-item">
              <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>

<script type="text/javascript" src="/js/jquery.min.js"></script>
<script src="/cms/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/cms/js/xadmin.js"></script>
<script>
  layui.use(['form', 'layedit', 'upload', 'laydate'], function () {
    var form = layui.form,
        layer = layui.layer;
    var $ = layui.$;
    var upload = layui.upload;
    var layedit = layui.layedit;
    layedit.set({	//设置图片接口
      uploadImage: {
        url: '/file/uploads', //接口url
        type: 'post'
      }
    });

    //创建一个编辑器
    var index = layedit.build('lay_edit',{
      height: 350
    });
    //提交时把值同步到文本域中
    form.verify({
      //content富文本域中的lay-verify值
      content: function(value) {
        return layedit.sync(index);
      }
    });


    //执行实例
    var uploadInst = upload.render({
      elem: '#test1' //绑定元素
      , url: '/file/upload' //上传接口
      , done: function (res) {
        $("#headImg").val("");
        $("#headImg").val(res.data);
        layer.msg(res.msg);
      }
      , error: function () {
        layer.msg("上传失败！")
      }
    });


    //监听提交
    form.on('submit(demo1)', function (data) {

      return false;

    });


  });
</script>
</body>


</html>